import math

def prime(num):
    """判断素数"""
    for x in range(2, int(math.sqrt(num)) + 1):
        if num % x == 0:
            return False
    return True


# print(prime(10))
l = []
def monisen(no):
    a: int
    a = 0
    start = 2
    while True:
        for p in range(start, start + 10):

         #   print(p, end=" ")
         #   print(prime(p))
            if prime(p):
                break
         #   print(p)
        start = p + 1
        m = 2 ** p - 1
        if prime(m):
            l.append(m)
            a += 1
        if no == a:
            return m


print(monisen(int(input())))
print(l)